home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / HAMRADIO / LOGBOOK.ZIP / LOG2DBF.PRG < prev    next >
Text File  |  1986-06-09  |  3KB  |  96 lines

  1. *LOG2DBF CONVERTS A BASIC LOG FILE TO A DATABASE VERSION 851114
  2. STORE 'LOG' TO log
  3. IF FILE (log)
  4.    USE &log
  5.    * EMPTY LOG FILE
  6.  
  7.    STORE ' ' TO contestlog
  8.    ACCEPT 'What is the name of the contest log (D:NAME) ' TO contestlog
  9.    IF FILE (contestlog)
  10.       ? 'ERROR,',contestlog,' ALREADY EXISTS'
  11.       WAIT
  12.    ELSE
  13.       IF FILE (contestlog+'.LOG')
  14.          COPY STRUCTURE TO &contestlog
  15.          ?
  16.          ? ' New database file created'
  17.          USE &contestlog
  18.          STORE TRIM(contestlog) + '.LOG' TO oldlog
  19.          ?
  20.          ? 'Copying log data now'
  21.          SET TALK ON
  22.          APPEND  FROM &oldlog SDF DELIM
  23.          SET TALK OFF
  24.          STORE ' ' TO df
  25.          ACCEPT ' Do you want a listing of the database (Y/N) ? ' TO df
  26.          IF df = 'Y'
  27.             LIST
  28.             ?
  29.          ENDIF
  30.          ?
  31.  
  32.          ACCEPT 'Do you want the contacts numbered (Y/N) ? ' TO df
  33.          IF df = 'Y'
  34.             STORE 1 TO qsocount
  35.             GOTO TOP
  36.             DO WHILE .NOT. EOF
  37.                REPLACE rx WITH $(comments,1,3)
  38.                REPLACE comments WITH $(comments,4,10)
  39.                IF df = 'Y'
  40.                   STORE STR(qsocount,10) TO number
  41.                   DO WHILE $(number,1,1) = ' '
  42.                      STORE $(number,2,10) TO number
  43.                   ENDDO
  44.                   REPLACE comments WITH TRIM(number)+'-'+comments
  45.                   STORE qsocount + 1 TO qsocount
  46.                ENDIF
  47.                DISP
  48.                SKIP
  49.             ENDDO
  50.          ENDIF
  51.  
  52.          ACCEPT 'Do you want to INDEX the contest log (DBF) (Y/N) ? ' TO df
  53.          IF df = 'Y'
  54.             ?
  55.             USE &contestlog
  56.             SET TALK ON
  57.             INDEX ON call+band TO &contestlog
  58.             SET TALK OFF
  59.             ? 'TO PRINT CONTEST LOG, go back to main menu'
  60.             ?
  61.             ? 'SET LOG TO contestlog, AND PRINT IT'
  62.             WAIT
  63.          ENDIF
  64.  
  65.          ACCEPT 'Append the new log to the main logbook (Y/N) ? ' TO df
  66.          IF df = 'Y'
  67.             ?
  68.             IF FILE (logbook)
  69.                USE &logbook INDEX &logbook
  70.                SET TALK ON
  71.                APPEND FROM &contestlog
  72.                SET TALK OFF
  73.             ELSE
  74.                ? 'ERROR,',logbook,' IS NOT ON DEFAULT DRIVE'
  75.                WAIT
  76.             ENDIF
  77.          ENDIF
  78.  
  79.          ACCEPT 'Do you want to make the contest log the default log ? ' TO df
  80.          IF df = 'Y'
  81.             STORE contestlog TO logbook
  82.          ENDIF
  83.       ELSE
  84.          ? 'ERROR CONTEST LOG IS NOT ON DEFAULT DRIVE'
  85.          WAIT
  86.       ENDIF
  87.    ENDIF
  88. ELSE
  89.    ? 'BLANK LOG IS NOT ON DEFAULT DRIVE'
  90.    WAIT
  91. ENDIF
  92. RELEASE oldlog,df,contestlog,log
  93. USE
  94. RETURN
  95.  
  96.